var http_head = "http://127.0.0.1";

var URL_VIDEO_LETV = "/vrs/video/one/letv.jsn?videoId=";
var URL_AUDIO_DETAIL = "/vrs/music/one.jsn?audioId=";

var VIDEO_MOBILE_DETAIL_URL = "http://wap.zhengzai.tv/h5pay/detail.html";
var VIDEO_OTT_DETAIL_URL = "http://wap.zhengzai.tv/ottpay/detail.html";

var LIVE_VIDEO_STOP = "/vrs/video/stoplive.jsn?videoId=";
var CREATE_VIDEO_BY_LIVE = "/vrs/video/createByLive.jsn?videoId=";

var READY_IMG_1242X416 = "/images/upload_1242x416.jpg";


/**
 * Created by wxnacy on 2015/8/12.
 */
$(function() {

});
/**
 *  swal({
            title: '确认此操作吗?',
            //text: 'You will not be able to recover this imaginary file!',
            type: 'warning',
            showCancelButton: true,是否显示取消按钮
            //confirmButtonColor: '#DD6B55',
            confirmButtonText: '确定!',
            closeOnConfirm: true,点击确定后弹框是否关闭
            cancelButtonText:'取消'
        },function() {
 */

/**
 * var msg = '最后一个不能删除';
 var type = 'error';
 var $layout = 'topRight';
 notyRestart(msg,type,$layout);
 */

/**
 * 弹窗提示
 * @param msg
 * @param type
 * @param $layout
 */
function notyRestart(msg,type,$layout){
    noty({
        theme: 'urban-noty',
        text: msg,
        type: type,
        timeout: 3000,
        layout: $layout,
        closeWith: ['button', 'click'],
        animation: {
            open: 'in',
            close: 'out',
            easing: 'swing'
        }
    });

}



// 生成随机数
function getRandomString(len) {
    len = len || 32;
    var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; // 默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1
    var maxPos = $chars.length;
    var pwd = '';
    for (i = 0; i < len; i++) {
        pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
    }
    return pwd;
}

//获取html传参
function getValue(key) {
    var name = key;
    var str = window.location.search;
    if (str.indexOf(name) != -1) {
        var pos_start = str.indexOf(name) + name.length + 1;
        var pos_end = str.indexOf("&", pos_start);
        if (pos_end == -1) {
            return decodeURIComponent(str.substring(pos_start));
        } else {
            return decodeURIComponent(str.substring(pos_start, pos_end));
        }
    }
}

/**
 * 获取域名
 * @returns {string}
 */
function getDomainName(){
    var str = window.location.href;
    str = str.substring(str.indexOf('//')+2);
    str = str.substring(0,str.indexOf('/'));
    console.log(str);
    return str;
}